<template>
	<view>
	<view v-if="xzzt==1">
		<!--免费下载-->
		<block v-for="(item, index) in xiazaifujian" :key="index">
			<view class="d-neikuang-10 d-shang-10  d-yuanjiao-10 " :style="[{'background-color': fenggeyanse =='light'? '#f1f1f1':'#0d0d0d'}]">
					<view class=" d-buhuanhang" >
						<view class="d-kuan-40 d-shang-4">
							<image :src="xiazaitu" class="d-img-40" ></image>
						</view>
						<view class="d-kuan d-zuo-10">
							<view v-if="xzxz==1" class="d-wenzi-hei">免费下载</view>
							<view v-if="xzxz==2" class="d-wenzi-hei">会员下载</view>
							<view v-if="xzxz==3" class="d-wenzi-hei">统一付费</view>
							<view v-if="xzxz==4" class="d-wenzi-hei">积分下载</view>
							<view v-if="xzxz==5" class="d-wenzi-hei">点赞下载</view>
							<view v-if="xzxz==6" class="d-wenzi-hei">评论下载</view>
							<view class="d-wenzi-12 d-wenzi-yanse-hui"> {{item.title}} 
								<text v-if="xzxz==3">：{{yuexia}} 元</text>
								<text v-if="xzxz==4">：{{yuexia}} </text>
							</view>
						</view>
						<!--下载-->
						<view v-if="fufeixiazai" class="d-kuan-100">
							<view v-if="urlzhi == 1" class="d-shang-10 d-neirong-juzhong d-hanggao-25 d-wenzi-yanse-bai d-wenzi-14 d-beijing-hei d-yuanjiao-50 d-kuan-50 d-gao-26" @click="fujianurl(item.url)">下载</view>
							<view v-else class="d-shang-10 d-neirong-juzhong d-hanggao-25 d-wenzi-yanse-bai d-wenzi-14 d-beijing-hei d-yuanjiao-50 d-kuan-50 d-gao-26" @click="tiezi(acid,aid,urlzhi)">下载</view>
						</view>
						<view v-else-if="userInfo" class="d-kuan-100">
							<view v-if="urlzhi == 1" class="d-shang-10 d-neirong-juzhong d-hanggao-25 d-wenzi-yanse-bai d-wenzi-14 d-beijing-hei d-yuanjiao-50 d-kuan-50 d-gao-26" @click="fukuan(xzxz)">下载</view>
							<view v-else class="d-shang-10 d-neirong-juzhong d-hanggao-25 d-wenzi-yanse-bai d-wenzi-14 d-beijing-hei d-yuanjiao-50 d-kuan-50 d-gao-26" @click="tiezi(acid,aid,urlzhi)">下载</view>
						</view>
						<view v-else class="d-kuan-100">
							<view v-if="urlzhi == 1" class="d-shang-10 d-neirong-juzhong d-hanggao-25 d-wenzi-yanse-bai d-wenzi-14 d-beijing-hei d-yuanjiao-50 d-kuan-50 d-gao-26" @click="denglu()">下载</view>
							<view v-else class="d-shang-10 d-neirong-juzhong d-hanggao-25 d-wenzi-yanse-bai d-wenzi-14 d-beijing-hei d-yuanjiao-50 d-kuan-50 d-gao-26" @click="tiezi(acid,aid,urlzhi)">下载</view>
						</view>
					</view>
				<view class="d-clear"></view>
			</view>
		</block>
		<block v-for="(item, index) in yunxiazai" :key="index">
			<view class="d-neikuang-10 d-shang-10  d-yuanjiao-10 " :style="[{'background-color': fenggeyanse =='light'? '#f1f1f1':'#0d0d0d'}]">
					<view class=" d-buhuanhang">
						<view class="d-kuan-40 d-shang-4">
							<image :src="xiazaiyun" class="d-img-40" ></image>
						</view>
						<view class="d-kuan d-zuo-10">
							<view v-if="xzxz==1" class="d-wenzi-hei">免费下载</view>
							<view v-if="xzxz==2" class="d-wenzi-hei">会员下载</view>
							<view v-if="xzxz==3" class="d-wenzi-hei">统一付费</view>
							<view v-if="xzxz==4" class="d-wenzi-hei">积分下载</view>
							<view v-if="xzxz==5" class="d-wenzi-hei">点赞下载</view>
							<view v-if="xzxz==6" class="d-wenzi-hei">评论下载</view>
							<view class="d-wenzi-12 d-wenzi-yanse-hui">
								云盘下载 
							    <span v-if="fufeixiazai">{{item['1']}} 
									<text v-if="item['3']">下载码：{{item['3']}}</text> 
								</span>
								<text v-if="xzxz==3">{{yuexia}} 元</text>
								<text v-if="xzxz==4">{{yuexia}} 积分</text>
							</view>
						    <!--view class="d-wenzi-12 d-wenzi-yanse-hui">云盘下载</view-->
						</view>
						<!--下载-->
						<view v-if="fufeixiazai" class="d-kuan-100">
							<view v-if="urlzhi == 1" class="d-shang-10 d-neirong-juzhong d-hanggao-25 d-wenzi-yanse-bai d-wenzi-14 d-beijing-hei d-yuanjiao-50 d-kuan-50 d-gao-26" @click="yunurl(item['2'],item['3'])">下载</view>
							<view v-else class="d-shang-10 d-neirong-juzhong d-hanggao-25 d-wenzi-yanse-bai d-wenzi-14 d-beijing-hei d-yuanjiao-50 d-kuan-50 d-gao-26" @click="tiezi(acid,aid,urlzhi)">下载</view>
						</view>
						<view v-else-if="userInfo" class="d-kuan-100">
							<view v-if="urlzhi == 1" class="d-shang-10 d-neirong-juzhong d-hanggao-25 d-wenzi-yanse-bai d-wenzi-14 d-beijing-hei d-yuanjiao-50 d-kuan-50 d-gao-26" @click="fukuan(xzxz)">下载</view>
							<view v-else class="d-shang-10 d-neirong-juzhong d-hanggao-25 d-wenzi-yanse-bai d-wenzi-14 d-beijing-hei d-yuanjiao-50 d-kuan-50 d-gao-26" @click="tiezi(acid,aid,urlzhi)">下载</view>
						</view>
						<view v-else class="d-kuan-100">
							<view v-if="urlzhi == 1" class="d-shang-10 d-neirong-juzhong d-hanggao-25 d-wenzi-yanse-bai d-wenzi-14 d-beijing-hei d-yuanjiao-50 d-kuan-50 d-gao-26" @click="denglu()">下载</view>
							<view v-else class="d-shang-10 d-neirong-juzhong d-hanggao-25 d-wenzi-yanse-bai d-wenzi-14 d-beijing-hei d-yuanjiao-50 d-kuan-50 d-gao-26" @click="tiezi(acid,aid,urlzhi)">下载</view>
						</view>
					</view>
				<view class="d-clear"></view>
			</view>
		</block>
	</view>
	<!--会员免费-->
	<view v-if="xzzt==2">
		
	</view>
	<!--统一付费-->
	<view v-if="xzzt==3">
		
	</view>
	<!--积分-->
	<view v-if="xzzt==4">
		
	</view>
	<!--点赞-->
	<view v-if="xzzt==5">
		
	</view>
	<!--评论-->
	<view v-if="xzzt==6">
		
	</view>
	</view>
</template>

<script>
	import config from "../../utils/config";
	export default{
		props:{
			aid: {
				type: [String, Number],
				default: ''
			},
			acid: {
				type: [String, Number],
				default: ''
			},
			xzzt: {
				type: [String, Number],
				default: ''
			},
			xzxz: {
				type: [String, Number],
				default: ''
			},
			xiazaifujian:{
				type: [Array,Object],
				default() {
				  return {};
				}
			},
			yunxiazai:{
				type: [Array,Object],
				default() {
				  return {};
				}
			},
			urlzhi: {
				type: [String, Number],
				default: ''
			},
			fenggeyanse: {
				type: [String, Number],
				default: ''
			},
			fufeixiazai: {
				type: Boolean,
				default: false
			},
			userInfo: {
				type: [String, Number],
				default: ''
			},
			yuexia: {
				type: [String, Number],
				default: ''
			}
		},
		data(){
			return {
				xiazaitu:config.getDomain+'/static/default/quan/img/yasuo.png',
				xiazaiyun:config.getDomain+'/static/default/quan/img/yun.png',
			}
		},
		
		methods:{
			//帖子
			tiezi(cid,id,urlzhi) {
				if(urlzhi ==1) {
					this.$emit('xiazaifujian', cid,id);
				} else {
					this.$emit('tiezi', cid,id);
				}
			},
			// 附件
			fujianurl(url) {
				this.$emit('fujianurl', url);
			},
			//云url
			yunurl(url,ma) {
				this.$emit('yunurl', url,ma);
			},
			//登陆
			denglu() {
				this.$emit('denglu');
			},
			fukuan(id) {
				this.$emit('fukuan',id);
			}
		}
	}
</script>

<style lang="scss" scoped>
	
</style>
